<?php
$html = null;
if(have_posts())
{	
	while (have_posts())
	{
		the_post();
		$postID = get_the_ID();
		$title = get_the_title($postID);
		$perlink = get_permalink($postID);
		$alt = db_vietnamese_slug($title);
		$thumbnail = db_get_post_meta($postID, $wpdb->prefix.'thumbnail');		
		$price = get_post_meta($postID,$wpdb->prefix.'price',true);
		$location = get_post_meta($postID, $wpdb->prefix.'address',true);
		$rating = get_post_meta($postID, $wpdb->prefix.'rating',true);
		
		if(!$rating)
			$rating = 1;
		$html.='
		<li>
            <div class="box-img">
            <a href="'.$perlink.'" title="'.$title.'">
                 <img alt="'.$alt.'" src="'.$thumbnail.'" />
             </a>    
            </div>
            <div class="box-info">
               <div class="star">';
				
				for ($j=1;$j<=$rating;$j++)
				{				
					$html.='<img style="padding:0; border:none; left:0; top:0; width:14px; height:14px;" alt="" src="'.get_bloginfo("template_url").'/images/star.png" />';				 	
				} 
				
				$html.='          	                  
               </div>
               <div class="details-info">
                   <a href="'.$perlink.'" class="name">'.$title.'</a>
                   <span style="display:block; float:left; width:150px; font-weight:bold; line-height:18px; color:#666;" class="price">Price: '.$price.' USD</span>
                   <span class="note">'.$location.'</span>
                </div>
             </div>
         </li>';		
	}
	wp_reset_query();
	
}
else 
{
	$html.='<li>No Hotel!.</li>';
}
echo $html;